@echo off
setlocal enabledelayedexpansion

REM 定义要删除的网关地址
set TargetGateway=10.129.188.14

for /f "tokens=1-4 delims= " %%a in ('route print') do (
    if "%%c" == "%TargetGateway%" (
        echo route delete %%a %%c
        route delete %%a %%c
    )
)
echo Done.


REM vpn的网关和虚拟接口 10.129.188.14    10.129.188.17
route add 172.30.1.110 mask 255.255.255.255 10.129.188.14 if 10.129.188.17

route print
pause
